//package com.yunhan.system.service;
//
//import jakarta.annotation.Resource;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//
///**
// * @author 王陈用
// */
//public class UserDetailsServiceImpl implements UserDetailsService {
////    @Resource
////    private UserMapper userMapper;
//
//
//
//    /**
//     *
//     * @param username
//     * @return
//     * @throws UsernameNotFoundException
//     */
//    @Override
//    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
//        UserEntity userEntity = userMapper.selectOne(Wrappers.<UserEntity>lambdaQuery()
////                .eq(UserEntity::getIsSystem, 0)
//                .eq(UserEntity::getUsername, username));
//        Assert.notNull(userEntity, "用户不存在！");
//        Assert.isTrue(userEntity.getState()==1, "用户已禁用！");
//        SecurityUser securityUser = BeanUtil.copyProperties(userEntity, SecurityUser.class);
//        return securityUser;
//    }
//}